package initalize

import (
	"RoccBlog/config"
	"fmt"
	"github.com/go-redis/redis/v8"
)

func InitRedis(conf config.Redis) *redis.Client {
	return redis.NewClient(&redis.Options{
		Addr:     fmt.Sprintf("%s:%d", conf.Host, conf.Port),
		Username: conf.Username,
		Password: conf.Password,
		DB:       conf.Db,
	})
}
